package controlador;

import classes.entidade.Orgao;
import dao.OrgaoDao;
import erro.ConexaoException;
import erro.ConsultaException;
import java.util.ArrayList;

/**
 *
 * @author roberta.m.carvalho
 */
public class OrgaoControl {

    private OrgaoDao dao;

    public OrgaoControl() {

        this.dao = new OrgaoDao();
    }

    public void inserirOrgao(Orgao o) throws ConexaoException, ConsultaException {
        this.dao.inserirOrgao(o);
    }

    public void alterarOrgao(Orgao o) throws ConexaoException, ConsultaException {
        this.dao.alterarOrgao(o);
    }

    public ArrayList<Orgao> listarOrgao() throws ConexaoException, ConsultaException {
        return (ArrayList<Orgao>) this.dao.listarOrgao();
    }

    public void deletarOrgao(Orgao o) throws ConexaoException, ConsultaException {
        this.dao.deletarOrgao(o);
    }
}
